<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>安装</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="fann.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="fann.configuration.html">运行时配置</a></div>
 <div class="up"><a href="fann.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="fann.installation" class="section">
  <h2 class="title">安装</h2>
  <p class="para">
   The FANN PHP extension should work on all Linux systems.
 </p>

  <ul class="simplelist">
   <li class="member">
    <a href="fann.installation.html#fann.installation.lib" class="xref">FANN Library Installation</a>
   </li>
   <li class="member">
    <a href="fann.installation.html#fann.installation.pecl" class="xref">PECL Installation</a>
   </li>
   <li class="member">
    <a href="fann.installation.html#fann.installation.manual" class="xref">Manual Installation</a>
   </li>
  </ul>

  <div class="section" id="fann.installation.lib">

   <h2 class="title">FANN Library Installation</h2>

   <p class="para">
    Before you start installation make sure that <em class="emphasis">libfann</em> is installed
    on your system. It&#039;s part of the main repository in the most Linux distributions
    (search for `fann`). You need a development version.
   </p>
   <p class="para">
    If it is not installed, you need to install it first. Either download it from the
    <a href="http://leenissen.dk/fann/wp/" class="link external">&raquo;&nbsp;official site</a> or get it from your distro
    repository. For example on Fedora:
    <div class="example-contents">
<div class="cdata"><pre>

$ sudo yum install fann-devel

</pre></div>
    </div>

    or Ubuntu:
    <div class="example-contents">
<div class="cdata"><pre>

$ sudo apt-get install libfann-dev

</pre></div>
    </div>

   </p>
  </div>

  <div class="section" id="fann.installation.pecl">

   <h2 class="title">PECL Installation</h2>

   <p class="para">
    This extension is available on PECL. The installation is very simple. Just run:
    <div class="example-contents">
<div class="cdata"><pre>

$ sudo pecl install fann

</pre></div>
    </div>

   </p>
  </div>

  <div class="section" id="fann.installation.manual">

   <h2 class="title">Manual Installation</h2>

   <p class="para">
    For developers and people interested in the latest changes, you
    can compile the driver from the latest source code on
    <a href="https://github.com/bukka/php-fann" class="link external">&raquo;&nbsp;Github</a>.
    Go to Github and click the &quot;Download ZIP&quot; button. Then run:

    <div class="example-contents">
<div class="cdata"><pre>

$ unzip php-fann-master.zip
$ cd php-fann-master
$ phpize
$ ./configure
$ make all
$ sudo make install

</pre></div>
    </div>

   </p>

   <p class="para">
    Make the following changes to php.ini:
   </p>
   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      Make sure the <em class="emphasis">extension_dir</em> variable is pointing to
      the directory containing <em class="emphasis">fann.so</em>. The build will display where
      it is installing the PHP driver with output that looks something like:
      <div class="example-contents">
<div class="cdata"><pre>

Installing &#039;/usr/lib/php/extensions/no-debug-non-zts-20060613/fann.so&#039;

</pre></div>
      </div>


      Make sure that it is the same as the PHP extension directory by runnning:

      <div class="example-contents">
<div class="cdata"><pre>

$ php -i | grep extension_dir
  extension_dir =&gt; /usr/lib/php/extensions/no-debug-non-zts-20060613 =&gt;
                   /usr/lib/php/extensions/no-debug-non-zts-20060613

</pre></div>
      </div>


      If it&#039;s not, change the <em class="emphasis">extension_dir</em> in php.ini or
      move <em class="emphasis">fann.so</em>.
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      To load the extension on PHP startup, add a line:

      <div class="example-contents">
<div class="cdata"><pre>

extension=fann.so

</pre></div>
      </div>


     </p>
   </li>

   </ul>
  </div>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="fann.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="fann.configuration.html">运行时配置</a></div>
 <div class="up"><a href="fann.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
